From d0706d17dd3190562439f79a42e3f4827a693abe Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Mon, 16 Jul 2007 14:28:54 +0100 Subject: [PATCH] [HVM] Qemu rtl8139: correct rx CRC calculation Signed-off-by: Tim Deegan --- tools/ioemu/hw/rtl8139.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/ioemu/hw/rtl8139.c b/tools/ioemu/hw/rtl8139.c index df4f3eebdd..5e8ae9bba2 100644 --- a/tools/ioemu/hw/rtl8139.c +++ b/tools/ioemu/hw/rtl8139.c @@ -53,9 +53,8 @@ /* debug RTL8139 card C+ mode only */ //#define DEBUG_RTL8139CP 1 -/* RTL8139 provides frame CRC with received packet, this feature seems to be - ignored by most drivers, disabled by default */ -//#define RTL8139_CALCULATE_RXCRC 1 +/* Calculate CRCs propoerly on Rx packets */ +#define RTL8139_CALCULATE_RXCRC 1 /* Uncomment to enable on-board timer interrupts */ //#define RTL8139_ONBOARD_TIMER 1 @@ -1030,7 +1029,7 @@ static void rtl8139_do_receive(void *opaque, const uint8_t *buf, int size, int d /* write checksum */ #if defined (RTL8139_CALCULATE_RXCRC) - val = cpu_to_le32(crc32(~0, buf, size)); + val = cpu_to_le32(crc32(0, buf, size)); #else val = 0; #endif @@ -1136,7 +1135,7 @@ static void rtl8139_do_receive(void *opaque, const uint8_t *buf, int size, int d /* write checksum */ #if defined (RTL8139_CALCULATE_RXCRC) - val = cpu_to_le32(crc32(~0, buf, size)); + val = cpu_to_le32(crc32(0, buf, size)); #else val = 0; #endif -- 2.30.2